<template>
	<!-- <view class="audit-container"> -->
	<view>
		<pageAduit
			:pageUrl="pageUrl"
			:salesContractData="salesContractData"
			:formFields="formFields"
			:formOptions="formOptions"
			:detailColumns="detailColumns"
			@masterDate="masterDate"
		></pageAduit>
	</view>
</template>

<script>
export default {
	data() {
		return {
			pageUrl: 'q_warehouse_add_allot',
			salesContractData: {
				workTable: 'workTable',
				tableKey: 'tableKey'
			},
			//4、配置当前表要显示的字段
			formFields: {
				Coding: '',
				Goods_num: '',
				Tax_rate: '',
				Ja_ja_lv: '',
				WHSE_name_out: '',
				WHSE_name_in: '',
			},
			//5、配置当前显示表单参数，可以直接从生成的SellOrderOptions.js页面将editFormFields与editFormOptions复制过来
			formOptions: [
				{
					title: 'ID',
					required: true,
					field: 'Add_allot',
					hidden: true,
					readonly: true
				},
				{
					title: '单据编码',
					field: 'Coding',
					readonly: true
				},
				{
					title: '调出数量',
					field: 'Goods_num',
					readonly: true
				},{
					title: '调拨金额',
					field: 'Total_price',
					readonly: true
				},
				{
					title: '税率',
					field: 'Tax_rate',
					readonly: true,
					data: [],
					key: '税率'
				},
				{
					title: '加价率',
					field: 'Ja_ja_lv',
					readonly: true,
				},
				{
					title: '调出机构',
					field: 'WHSE_name_out',
					readonly: true,
					data: [],
					key: '一级仓库'
				},
				{
					title: '调入机构',
					field: 'WHSE_name_in',
					readonly: true,
					data: [],
					key: '一级仓库'
				}
			],
			detailColumns: [
				{
					field: 'Add_allotList',
					title: 'ID',
					hidden: true
				},
				// {
				// 	field: 'Goods_name',
				// 	title: '商品名称',
				// 	type: 'string',
				// 	readonly: true
				// },
				{
					field: 'Goods_sub',
					title: '商品',
					require: true,
					bind: {
						key: '商品',
						data: []
					},
					type: 'select',
				},
				{
					field: 'Goods_size',
					title: '规格型号',
					readonly: true
				},
				{
					field: 'Goods_num',
					title: '数量',
					readonly: true
				},
				{
					field: 'Goods_price',
					title: '调入价格',
					readonly: true
				}
			]
		};
	},
	methods: {
		masterDate(val) {
			val.Ja_ja_lv+="%"
			Object.assign(this.formFields, val);
		}
	},
	onLoad(options) {
		this.salesContractData = {
			workTable: options.workTable,
			tableKey: options.tableKey
		};
	}
};
</script>

<style lang="less" scoped>
.audit-container {
	position: absolute;
	height: 100%;
	width: 100%;
	overflow-y: scroll;
	background: #f9f9f9;
	padding: 20rpx;
	box-sizing: border-box;

	.audit-form,
	.audit-action {
		border-radius: 5px;
		background: #ffff;
	}
}
</style>
